package com.jt.assistant.adapter

import android.annotation.SuppressLint
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import coil.load
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.jt.assistant.R
import com.jt.assistant.bean.WaybillCityBean

class JDDialogListAdapter(mData: MutableList<WaybillCityBean>) :
    BaseQuickAdapter<WaybillCityBean, BaseViewHolder>(
        R.layout.item_layout_jd_dialog, mData
    ) {

    @SuppressLint("SetTextI18n")
    override fun convert(holder: BaseViewHolder, item: WaybillCityBean) {
        val order = holder.getView<TextView>(R.id.jd_order_tv)
        val cartonNum = holder.getView<TextView>(R.id.carton_num_tv)
        val check = holder.getView<ImageView>(R.id.jd_check_iv)

        order.text = item.channelOrderNo
        cartonNum.text = item.cartonNum.toString()
        if (item.isChoose)
            check.load(R.mipmap.icon_checked)
        else
            check.load(R.mipmap.icon_uncheck)
    }


}